import request from '@/utils/request'

// 查询项目bugs列列表
export function listBugs(query) {
  return request({
    url: '/business/bugs/list',
    method: 'get',
    params: query
  })
}


// 查询外部供应商bugs列列表
export function listBugsGys(query) {
  return request({
    url: '/business/bugs/wbgys',
    method: 'get',
    params: query
  })
}


// 查询项目bugs列详细
export function getBugDatail(id) {
  return request({
    url: '/business/bugs/getBugsDetail/' + id,
    method: 'get'
  })
}

// 新增项目bugs列
export function addBugs(data) {
  return request({
    url: '/business/bugs/add',
    method: 'post',
    data: data
  })
}

// 修改项目bugs列
export function updateBugs(data) {
  return request({
    url: '/business/bugs/update',
    method: 'post',
    data: data
  })
}

// 删除项目bugs列
export function delBugs(id) {
  return request({
    url: '/business/bugs/delete/' + id,
    method: 'GET'
  })
}

// 废弃bugs
export function waiveBugs(data) {
  return request({
    url: '/business/bugs/waive',
    method: 'post',
    data: data
  })
}

//关闭bugs
export  function closeBugs(data) {
  return request({
    url: '/business/bugs/close',
    method: 'post',
    data: data
  })
}

/**
 * 处理bugs
 * @param {*} data 
 * @returns 
 */
export function handleBugs(data){
  return request({
    url: '/business/bugs/handle',
    method: 'post',
    data: data
  })
}
/**
 * bug转办
 * @param {*} data 
 * @returns 
 */
export function transferBug(data){
  return request({
    url: '/business/bugs/transfer',
    method: 'post',
    data: data
  })
}

/**
 * 根据bug id查询bug操作日志
 * @param {*} id 
 * @returns 
 */
export function getBugHandleLog(id){
  return request({
    url: '/business/bugs/getHandleHistory/'+id,
    method: 'get'
  })
}

/**
 * 获取projectBugsList
 * @param {*} data 
 * @returns 
 */
export function projectBugsList(data) {
  return request({
    url: '/business/bugs/projectBugsList',
    method: 'get',
    params: data
  })
}
/**
 * 获取bug信息详情
 * @param {*} id 
 * @returns 
 */
export function getBugs(id){
  return request({
    url: '/business/bugs/getBugsDetail/' + id,
    method: 'get'
  })
}
/**
 * 重置bugs
 * @param {*} id 
 */
export function resetBugs(id) {
  return request({
    url: '/business/bugs/reset/' + id,
    method: 'get'
  })
}
/**
 * 重新激活bugs
 * @param {*} id 
 */
export function activationBugs(id) {
  return request({
    url: '/business/bugs/activation/' + id,
    method: 'get'
  })
}

/**
 * 获取测试统计数据
 * @param {*} data 
 * @returns 
 */
export function getHandleBugCount(data){
  return request({
    url: '/business/bugs/handleBugCount',
    method: 'get',
    params: data
  })
}

/**
 * 获取异常类别数据统计
 * @returns 
 */
export function getExceptionTypeCount(){
  return request({
    url: '/business/bugs/getExceptionTypeCount',
    method: 'get'
  })
}

/**
 * 查询Dqe bug结案数据统计
 * @returns 
 */
export function getCloseACaseDate(){
  return request({
    url: '/business/bugs/closeACaseDateCount',
    method: 'get'
  })
}

/**
 * 查询异常代码数据统计
 * @param {*} data 
 * @returns 
 */
export function getExceptionCodeTypeDate(data){
  return request({
    url: '/business/bugs/getExceptionCodeTypeCount',
    method: 'get',
    params: data
  })
}

/**
 * DQE查询研发申请waive的bug数据
 * @returns 
 */
export function getApproveWaiveBugList(data){
  return request({
    url: '/business/bugs/getApproveWaiveBugs',
    method: 'get',
    params: data
  })
}


/**
 * 研发查询申请waive的bug数据记录
 * @returns 
 */
export function getWaiveRecordBugList(data){
  return request({
    url: '/business/bugs/getWaiveRecordBugs',
    method: 'get',
    params: data
  })
}

/**
 * 推送waive单到Oa waive单签核审批流程
 * @param {*} data 
 * @returns 
 */
export function putOAWaive(data){
  return request({
    url: '/business/bugs/putOaWaive',
    method: 'POST',
    data: data
  })
}

/**
 * 根据项目编码查询汇总项目BUG类型数据
 * 
 * @param {*} data 
 * @returns 
 */
export function queryTotalBugTypeByProject(data){
  return request({
    url: '/business/bugs/queryTotalBugTypeByProject',
    method: 'POST',
    data: data
  })
}

/**
 * 根据项目编码查询汇总项目BUG数据
 * 
 * @param {*} data 
 * @returns 
 */
export function queryTotalBugByProject(data){
  return request({
    url: '/business/bugs/queryTotalBugByProject',
    method: 'POST',
    data: data
  })
}


